package com.es.disped.dao.mapper;

import com.es.disped.dao.model.SyllabusStudentRel;
import com.es.disped.dao.model.SyllabusStudentRelExample;
import java.util.List;

import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

//@CacheNamespace(implementation=(com.es.disped.dao.cache.RedisCache.class),size=512,flushInterval=60000)
public interface SyllabusStudentRelMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table syllabus_student_rel
     *
     * @mbg.generated Thu Jul 04 13:30:25 CST 2019
     */
    @SelectProvider(type=SyllabusStudentRelSqlProvider.class, method="countByExample")
    long countByExample(SyllabusStudentRelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table syllabus_student_rel
     *
     * @mbg.generated Thu Jul 04 13:30:25 CST 2019
     */
    @DeleteProvider(type=SyllabusStudentRelSqlProvider.class, method="deleteByExample")
    int deleteByExample(SyllabusStudentRelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table syllabus_student_rel
     *
     * @mbg.generated Thu Jul 04 13:30:25 CST 2019
     */
    @Delete({
        "delete from syllabus_student_rel",
        "where rel_id = #{relId,jdbcType=CHAR}"
    })
    int deleteByPrimaryKey(String relId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table syllabus_student_rel
     *
     * @mbg.generated Thu Jul 04 13:30:25 CST 2019
     */
    @Insert({
        "insert into syllabus_student_rel (rel_id, syllabus_id, ",
        "syllabus_name, student_id, ",
        "student_name, student_type, ",
        "join_date)",
        "values (#{relId,jdbcType=CHAR}, #{syllabusId,jdbcType=CHAR}, ",
        "#{syllabusName,jdbcType=VARCHAR}, #{studentId,jdbcType=CHAR}, ",
        "#{studentName,jdbcType=VARCHAR}, #{studentType,jdbcType=VARCHAR}, ",
        "#{joinDate,jdbcType=VARCHAR})"
    })
    int insert(SyllabusStudentRel record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table syllabus_student_rel
     *
     * @mbg.generated Thu Jul 04 13:30:25 CST 2019
     */
    @InsertProvider(type=SyllabusStudentRelSqlProvider.class, method="insertSelective")
    int insertSelective(SyllabusStudentRel record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table syllabus_student_rel
     *
     * @mbg.generated Thu Jul 04 13:30:25 CST 2019
     */
    @SelectProvider(type=SyllabusStudentRelSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="rel_id", property="relId", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="syllabus_id", property="syllabusId", jdbcType=JdbcType.CHAR),
        @Result(column="syllabus_name", property="syllabusName", jdbcType=JdbcType.VARCHAR),
        @Result(column="student_id", property="studentId", jdbcType=JdbcType.CHAR),
        @Result(column="student_name", property="studentName", jdbcType=JdbcType.VARCHAR),
        @Result(column="student_type", property="studentType", jdbcType=JdbcType.VARCHAR),
        @Result(column="join_date", property="joinDate", jdbcType=JdbcType.VARCHAR)
    })
    List<SyllabusStudentRel> selectByExample(SyllabusStudentRelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table syllabus_student_rel
     *
     * @mbg.generated Thu Jul 04 13:30:25 CST 2019
     */
    @Select({
        "select",
        "rel_id, syllabus_id, syllabus_name, student_id, student_name, student_type, ",
        "join_date",
        "from syllabus_student_rel",
        "where rel_id = #{relId,jdbcType=CHAR}"
    })
    @Results({
        @Result(column="rel_id", property="relId", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="syllabus_id", property="syllabusId", jdbcType=JdbcType.CHAR),
        @Result(column="syllabus_name", property="syllabusName", jdbcType=JdbcType.VARCHAR),
        @Result(column="student_id", property="studentId", jdbcType=JdbcType.CHAR),
        @Result(column="student_name", property="studentName", jdbcType=JdbcType.VARCHAR),
        @Result(column="student_type", property="studentType", jdbcType=JdbcType.VARCHAR),
        @Result(column="join_date", property="joinDate", jdbcType=JdbcType.VARCHAR)
    })
    SyllabusStudentRel selectByPrimaryKey(String relId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table syllabus_student_rel
     *
     * @mbg.generated Thu Jul 04 13:30:25 CST 2019
     */
    @UpdateProvider(type=SyllabusStudentRelSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") SyllabusStudentRel record, @Param("example") SyllabusStudentRelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table syllabus_student_rel
     *
     * @mbg.generated Thu Jul 04 13:30:25 CST 2019
     */
    @UpdateProvider(type=SyllabusStudentRelSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") SyllabusStudentRel record, @Param("example") SyllabusStudentRelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table syllabus_student_rel
     *
     * @mbg.generated Thu Jul 04 13:30:25 CST 2019
     */
    @UpdateProvider(type=SyllabusStudentRelSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(SyllabusStudentRel record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table syllabus_student_rel
     *
     * @mbg.generated Thu Jul 04 13:30:25 CST 2019
     */
    @Update({
        "update syllabus_student_rel",
        "set syllabus_id = #{syllabusId,jdbcType=CHAR},",
          "syllabus_name = #{syllabusName,jdbcType=VARCHAR},",
          "student_id = #{studentId,jdbcType=CHAR},",
          "student_name = #{studentName,jdbcType=VARCHAR},",
          "student_type = #{studentType,jdbcType=VARCHAR},",
          "join_date = #{joinDate,jdbcType=VARCHAR}",
        "where rel_id = #{relId,jdbcType=CHAR}"
    })
    int updateByPrimaryKey(SyllabusStudentRel record);
}